<?php
if(!empty($_POST))
{
	
	$id = $_POST['Id'];
	$_POST['permission_id']=json_encode($_POST['permission_id']);
	$result = update('permission', $_POST, $id);
	if($result)
	{
		echo '更新成功';
		header('Refresh:1;index.php?a=admin&b=permission&c=index');
		die;
	}else
	{
		echo '更新失败';
		header('Refresh:1;index.php?a=admin&b=permission&c=index');
		die;	
	}
}


$permission = selectAll('menu',1,'*','order by Id asc');
$id = $_GET['id'];
$re = selectone('permission','Id='.$id);
$re['permission_id'] = json_decode($re['permission_id']);
//print_r($re);die;

include('app/admin/permission/html/update.html');
?>